package ch9;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;
import java.io.PrintWriter;
import java.net.ResponseCache;

@WebFilter(filterName = "ForwardFilter",urlPatterns = "/first.jsp",
dispatcherTypes = DispatcherType.FORWARD)
public class ForwardFilter implements Filter {
    public void destroy() {
    }

    public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException {
//        chain.doFilter(req, resp);
        PrintWriter out = resp.getWriter();
        out.write("test");
    }


    public void init(FilterConfig config) throws ServletException {

    }

}
